using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Hotran.SaveSystem;

public class TipUI : MonoBehaviour
{
    [SerializeField]
    private Fadable _savedTip;


    //private void Start()
    //{
    //    _savedTip.gameObject.SetActive(false);
    //}

    private void OnEnable()
    {
        SaveManager.Saved += SaveManager_Saved;
    }

    private void OnDisable()
    {
        SaveManager.Saved -= SaveManager_Saved;
    }

    private void SaveManager_Saved()
    {
        _savedTip.FadeIn();
        Invoke(nameof(HideSavedTip), 2f);
    }

    private void HideSavedTip() => _savedTip.FadeOut();
}
